<template>
  <a-radio-group @change="change" :value="model" :disabled="disabled">
    <a-radio value="red" style="color: red">红灯</a-radio>
    <a-radio value="green" style="color: green">绿灯</a-radio>
    <a-radio value="yellow" style="color: yellow">黄灯</a-radio>
  </a-radio-group>
</template>
<script>

export default {
  name: "Demo1",
  props: {
    value: String | Number,
    disabled: Boolean,
    record: Object,
    config: Object,
    obj: {
      type: Object,
      default: () => {
        return {}
      }
    },
    stores: {
      type: Object,
      default: () => {
        return {}
      }
    },
  },
  data() {
    return {
      model: null
    }
  },
  mounted() {
    //console.log(this.record.$vm)
  },
  methods: {
    change(e) {
      const val = e.target.value;

      this.$emit('input', val);
      this.$emit('change', val);
    }
  },
  watch: {
    value: {
      handler(value) {
        this.model = value
      },
      immediate: true
    }
  },
  model: {
    prop: 'value',
    event: 'change'
  }
}
</script>
